package com.google.gson.internal.bind;

import com.google.gson.b.a;
import com.google.gson.b.c;
import com.google.gson.b.d;
import com.google.gson.q;
import java.io.IOException;
import java.math.BigDecimal;

public final class b extends TypeAdapter {
    public BigDecimal a(a aVar) throws IOException {
        if (aVar.f() == c.NULL) {
            aVar.j();
            return null;
        }
        try {
            return new BigDecimal(aVar.h());
        } catch (Throwable e) {
            throw new q(e);
        }
    }

    public void a(d dVar, BigDecimal bigDecimal) throws IOException {
        dVar.a((Number) bigDecimal);
    }

    public /* synthetic */ Object b(a aVar) throws IOException {
        return a(aVar);
    }
}
